package io.renren.modules.app.controller;

import io.renren.common.utils.R;
import io.renren.modules.app.service.ApiAdService;
import io.renren.modules.sys.entity.AdEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/**
 * 广告
 * @author wangyi
 * @mail 794651397@qq.com
 * @createdate 2018/3/15 17:52
 **/
@Api(description = "广告")
@RestController
@RequestMapping("/app")
public class ApiAdController {
    @Autowired
    private ApiAdService apiAdService;
    
    /**
     * 获取广告
     * @author wangyi
     * @createdate 2018/3/15 17:52
     **/
    @ApiOperation("获取广告")
     @PostMapping("ad")
     public R ad(){
         HashMap<String,Object> map=new HashMap<>();
         map.put("status",1);
         List<AdEntity> list=apiAdService.queryList(map);
        return R.ok().put("result",list);
     }
}
